(function ($) {

    var OO = window.order_operation = {};
    console.log('order_operation created');

    //订单流程重写
    $('.js_order_operation').on('click', '.js_orderProgressBtn', function () {

        var el = $(this);

        var action = el.data("action");
        var order_id = el.data("order_id") || el.closest('tr').data('id');

        if (OO[action] && OO[action].call) {
            OO[action](order_id);
        } else {
            console.log(action + ' behavior not exist!');
        }

        // switch (action) {
        //     case 'DEALER_ACTION_CREATE' :  // 创建订单
        //         break;
        //     case 'DEALER_ACTION_MINUS' :// 确认扣款
        //         break;
        //     case 'DEALER_ACTION_ADD_GOODS' : // 添加备注(赠品)
        //         break;
        //     case 'DEALER_ACTION_CONFIRM' :// 确认订单
        //         break;
        //     case 'DEALER_ACTION_PRINT' :// 打印订单
        //         break;
        //     case 'DEALER_ACTION_PREPARE' : // 备货完毕
        //         break;
        //     case 'DEALER_ACTION_SEND' : // 发货
        //         break;
        //     case 'DEALER_ACTION_FILL_DELIVERY' :  // 填写订单号
        //         break;
        //     case 'DEALER_ACTION_DONE':  // 到货完结
        //         break;
        // }

        return false;
    });

})(jQuery);